#pragma once
#include <map>
#include "ShaderProgram.h"

class ShaderManager
{
	std::map<std::string, ShaderProgram*> m_shaderPrograms;
	std::map< std::string, Shader*> m_shaders;
	bool m_debugState;
	ShaderProgram* m_nullProgram;

public:
	ShaderManager();
	~ShaderManager();
	void createShaderProgram(std::string name);
	void attatchShader(std::string name, SHADERTYPE::ST shader);
	void attatchShaderToProgram(std::string program, std::string shader);
	GLuint getProgramID(std::string name);
	void compileShader(std::string name);
	void linkProgramObject(std::string name);
	void toogleDebug();
	void use(std::string name);
	void bindAttribute(std::string programName, GLuint index, std::string attribName);
	void loadShaderSource(std::string shaderName, std::string sourceFile);
	ShaderProgram * ShaderManager::operator[](const std::string &_programName);
};

